<%@ page language="java" contentType="text/html; charset=UTF-8" import="cn.com.longfuinfo.wx.common.OrderCode" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- amazeui -->
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/ui/css/amazeui.min.css" />
		<!-- lib -->
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/lib/swiper/css/swiper.min.css" />
		<!-- app -->
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/header.css"/>
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/order.css"/>
		<link rel="stylesheet" href="${BASE_PATH}/static/lib/myAlert/myAlert.css" />
		<title>订单详情</title>
		<style type="text/css">
			body{margin:0;padding:0}
			body{
				font:14px / 1.5 "Helvetica Neue",Helvetica,Arial,"Microsoft Yahei","Hiragino Sans GB","Heiti SC","WenQuanYi Micro Hei",sans-serif;
				-webkit-text-size-adjust:none; -webkit-user-select: none;
				background: #f7f7f7;
			}
			
			ul,li{margin:0;padding:0}
			ul,li{-webkit-tap-highlight-color:rgba(0,0,0,0)}
			li,ul{list-style-type:none;}
			i{font-style:normal; font-weight:normal}
			a{
			  text-decoration: none;
			  color: black;
			}
			.alert{
				width: 100%;
				height: 100%;
				background-color: rgba(0,0,0,0.3);
				position: absolute;
				top: 0;
				left: 0;
				display: none;
				z-index: 99;
			}
			.wx-ewm{
				width: 200px;
				height: 200px;
				position: absolute;
				left: 50%;
				top: 50%;
				margin-top: -100px;
				margin-left: -100px;
				z-index: 100;
				display: none;
			}
			.centert{
				width: calc(100% - 2em);
				background: #f7f7f7;
				margin-left: 1em;
			}
			.shangjia{
				display: inline-block;
				height: 26px;
				line-height: 26px;
				font-size: 13px;
				color: #a0a0a7;
			}
			.tit{
				float: left;
				width: calc(100% - 45px);
				line-height: 35px;
				font-size: 16px;
			}
			.nei{
				float: left;
				width: calc(100% - 45px);
				line-height: 15px;
				font-size: 13px;
			}
			.shop{
				height: 80px;
				line-height: 60px;
			}
			.shop span{
				/*width: 80%;*/
				display:block;
				color: #5C5C67;
			}
			.dianhua{
				line-height: 45px;
				float: right;
				margin-top: -38px;
				width: 45px;
				height: 45px;
				text-align: center;
				border-left:1px solid #f7f7f7 ;
				
			}
			.shop i{
				display: inline-block;
				width: 40px;
				height: 40px;
				margin-left: 5px;
				border-radius:40px;
				background: url(/static/app/img/dianhua.png) no-repeat 5px 3px;
				background-size:85% ;
			}
			.goods_pic{
				width: calc(100% - 2em);
				height: 200px;
				background-color: #f7f7f7;
				margin-left: 1em;
				/* border-bottom: 1px solid #DDDDDD; */
			}
			.goods_pic ul{
				margin-top: 10px;
				overflow:hidden;
				text-overflow:ellipsis;
				white-space:nowrap;
			}
			.goods_pic ul li{
				width: 30%;
				float: left;
			}
			.goods_pic img{
				width: 100%;
				margin-left: 0px;
				margin-top: 0px;
			}
			.pic_textl{
				height: 60px;
				width:66%;
				white-space:pre-wrap;
				display: inline-block;
				line-height: 17px; 
				margin-left: 6px;
				float: left;
				font-size: 16px;
				color: #5C5C67;
			}
			.pic_textl2{
				height: 20px;
				width:66%;
				display: inline-block;
				line-height: 20px;
				margin-left: 6px;
				/* margin-top: 60px; */
				float: left;
				text-decoration:line-through;color:#c0c0c0;
			}
			.pic_textl3{
				height: 20px;
				width:64%;
				display: inline-block;
				line-height: 20px;
				margin-top: 3%; 
				margin-left: 6px;
				color: #e4859d;
				float: left;
				
			}
			
			.pic_textr{
				float: right;
				margin-right: 20px;
				margin-top: -40px;
			}
			.goods_tot{
				height: 20px;
				display: inline-block;
				float: left;
				margin-left: 15px;
				margin-top: 20px;
			}
			.goods_rmb{
				height: 20px;
				display: inline-block;
				float: right;
				margin-right: 25px;
				color: #e4859d;
				font-size: 16px;
			}
			.goods_rmbs{
				height: 20px;
				display: inline-block;
				float: right;
				margin-right: 25px;
				margin-top: 10px;
				color: #c0c0c0;
			}
			.goods_rmb_nums{
				color: #c0c0c0;
				font-size: 14px;
			}
			.goods_rmb_num{
				color: #e4859d;
				font-size: 16px;
			}
			.order_nums {
				width: 100%;
				height: 45px;
				line-height: 45px;
				font-size: 13px;
				/* border-bottom: 1px solid #DDDDDD; */
				background: #f7f7f7;
			}
			.order_times {
				width: calc(100% - 2em);
				height: 120px;
				background: #f7f7f7;
				line-height: 30px;
				color: #333333;
				margin-left: 1em;
			}
			.order_timea {
				width: calc(100% - 2em);
				height: 230px;
				background: #f7f7f7;
				line-height: 30px;
				color: #333333;
				margin-left: 1em;
			}
			.sstate{
				float: right;
				margin-right: 30px;
				font-size: 14px;
				color: #c0c0c0;
			}
			.states{
				float: right;
				margin-right: 30px;
				font-size: 14px;
				color: #afdada;
			}
			.logo_text {
			    height: 40px;
			    line-height: 40px;
			    display: inline-block;
			    color: #595b60;
			    font-size: 14px;
			    margin-left: 6px;
				float: left;
			}
			.showw{
				margin-top: 39px;
			}
			a{
			  text-decoration: none;
			  color: black;
			}
			.info .tip{
			   display: inline-block;
			    font-size: 12px;
			    padding-left: 4%;
			    padding-right: 4%;
			    color: #808080;
			}
			.maskbox{
			    position: absolute;
			    top: 0;
			    z-index: -999;
			    width:100%;
			    height: 100%;
			    padding-top: 25%;
			    opacity: 0;
			    background:rgba(40, 37, 37, 0.49);
			}
			.maskbox h3{
			    text-align: center;
			    font-size: 15px;
			    padding: 5px;
			}
			.mask{
		        position: relative;
		        top: 20%;
			    width: 68%;
			    margin: 0 auto;
			    background: #ffffff;
			    border-radius: 5px;
			    color: #464646;	
			}
			.mask-text{
			    width: 94%;
			    margin:-15px auto 0;
			    padding-left: 5px;
			    font-size: 12px;
                color: #000000;
                text-align: center;
			    }
			.mask-text span{
			   display: inline-block;
			    width: 100%;
			    font-size: 12px;
			    padding-bottom: 15px;
			    color: #8c8a8a;
			   
			}    
			.mask-submit{
			    display: inline-block;
			    width: 100%;
			    height: 30px;
			    line-height: 30px;
			    text-align: center;
			    background: #afdada;
			    border-radius: 5px;
			    color: #ffffff;
			    cursor: pointer;
			} 
		</style>
	</head>
	<body>
		<div class="content">
		<header>
			<div class="header">
				<span class="back" onclick="javascript:history.go(-1);"></span>
				<a href="${BASE_PATH}/index"><span class="logo_pic"></span></a>
				<span class="logo_text">OK 妈咪</span>
			</div>
		</header>
			<div class="container showw" id="panel"></div>
		</div>
        <!-- 遮罩 -->
	<div class="maskbox">
	    <div class="mask">
	        <h3>提示</h3>
	        <div class="mask-text">
	            <p>您的订单已超过7天，不能申请退款 </p>
                <span>如有疑问可致电：0371-5863886</span>
	        </div> 
	         <span class="mask-submit">确定</span>
	    </div>	   
	</div>
	<input type="hidden" id="hidden" value="">
    <input type="hidden" id="hidden1" value="">
		<script src="${BASE_PATH}/static/app/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<!-- amazeui -->
		<script type="text/javascript" src="${BASE_PATH}/static/ui/js/amazeui.min.js"></script>
		<!-- lib -->
		<script type="text/javascript" src="${BASE_PATH}/static/lib/layer/layer.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/template/template.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery-lazyload/jquery.lazyload.min.js"></script>
		<!-- app -->
		<script type="text/javascript" src="${BASE_PATH}/static/app/js/kit.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/template/template-ext.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/myAlert/module.js"></script>
		<script type="text/javascript">
		    //遮罩层 退款时间过期点击退款提示框
		       var num=document.querySelector("#hidden"),
		           num1=document.querySelector("#hidden1"),
		           mask=document.querySelector(".maskbox"),
			       close=document.querySelector(".mask-submit"),
			       body=document.querySelector("body");
		           num.value="0";//默认商品类型为零
		           num1.value="0";//默认商品距离退款时间为零
			  function maskShow(){
				   mask.style.opacity="1";
				   mask.style.zIndex="999";
				   body.style.position="fixed";// 弹出层显示可禁止页面滚动
			   }
			   close.onclick=function(){
				   mask.style.opacity="0";
				   mask.style.zIndex= "-999";
				   body.style.position="static";
			   }
			$('#panel').on('click','.code',function(){
				$(".big_code").toggleClass('show');
				$(".bcode_box").toggleClass('show');
			})
			$('#panel').on('click','.big_code',function(){
				$(".big_code").toggleClass('show');
				$(".bcode_box").toggleClass('show');
			})
			var order;
			$(function(){
				//初始化显示订单信息
				Kit.ajax.post("${BASE_PATH}/order/getDetail",{orderNum:'${orderNum}'},function(result){
					if(result.flag==0){
						//渲染订单信息
						render(result.object.order);
						num.value=result.object.goodtype;//包含现金服务类专用
						num1.value=result.object.Sremain; //包含现金服务类专用退款时间
						//判断如果订单正常、在线支付、未付款时，启动倒计时
						if(result.object.order.payState==<%=OrderCode.OrderPayState.NO_PAY%>){
							timer(parseInt(result.object.order.remain/1000));
						}else if(result.object.order.payState==<%=OrderCode.OrderPayState.HAD_PAY%>&&result.object.order.orderState==<%=OrderCode.OrderState.NO_CON%>){
							timer(parseInt(result.object.order.remain/1000));
						}
					}else{
						Kit.ui.toast(result.message);
						setTimeout(function(){
							window.history.go(-1);
						},2000);
					}
				});
			});
			function render(obj){
				order = obj;
				$("#panel").empty().append(template("dataTpl",order));
				//图片延迟加载
				/* $("img.lazyload").not(".lazyload-binded").lazyload({
					failurelimit : 100,
					effect : "show"
				}).addClass("lazyload-binded"); */
			}
			function timer(remain){
				var day= parseInt((remain-1)/(24*60*60));
				var hours = parseInt((remain-1)/(60*60))-(day*24);
				var min = parseInt((remain-1)/60)-(day*24*60)-(hours*60);
				var second=parseInt((remain-1)%60);//还剩多少秒
				$("#day").text(day);
				$("#hours").text(hours);
				$("#min").text(min);
				if(day>0||hours>0||min>0||second >0){
					setTimeout(function(){
						timer(remain-1);
					}, 1000);
				}else{					
					if(num.value!="2"){
						Kit.ajax.post("${BASE_PATH}/order/doRefund",{orderNum:'${orderNum}'},function(result){
							if(result.flag==0){
							//重置加载标识
							window.location.reload(true) ;
							}
						})
			 		}else{
			 			 Kit.render.refresh();
			 		}		
				}
			}
			function toCancel(orderNum){
				myAlert.confirm("确认取消订单",function(){
				Kit.ajax.post("${BASE_PATH}/order/cancle",{orderNum:orderNum},function(result){
					if(result.flag==0){
							//重置加载标识
							window.history.go(-1);
					}else{
						myAlert.alert("取消失败");
						window.location.reload(true) ;
					}
				})
				})
			}
			function gopay(orderNum,amount){
				if(amount>0){
					Kit.render.redirect("${BASE_PATH}/order/prepay/"+orderNum);
				}else{
					Kit.render.redirect("${BASE_PATH}/order/jfpay/"+orderNum);
				}
			}
		 
		 	function doRefund(){
		 		/**
		 		*如果class为.goods不存在那么sum为空
		 		*判断是否已过有效期
		 		*/
		 		/*  var sam="";		 		
		 		try{
				   sam=document.querySelector(".goods").innerHTML;					
				}catch(e){
					sam="";
				}  */
				//((sam=="您已错过兑换有效时间") || (num1.value=="0"))
                //如果为服务类并且已过退款时间则不能退款 num1退款时间
	 			if(num.value=="2" && num1.value=="0"){
	 				maskShow()
				
		 		}
	 			else{ 
			 		myAlert.confirm("确认申请退款吗？",function(){
						Kit.ajax.post("${BASE_PATH}/order/doRefund",{orderNum:'${orderNum}'},function(result){
							if(result.flag==0){
								Kit.ui.alert("退款成功",function(){
									//重置加载标识
									window.location.reload(true) ;
								});
							}else{
								myAlert.alert("退款失败",function(){
									//重置加载标识
									window.location.reload(true) ;
								});
							}
						})
						})
		 		 }
		 	}
			
			function doDelete(){
				myAlert.confirm("确认删除吗？",function(){
					Kit.ajax.post("${BASE_PATH}/order/delete",{orderNum:'${orderNum}'},function(result){
 						if(result.flag==0){
 							myAlert.alert("订单删除成功！",function(){
 								Kit.render.redirect("${BASE_PATH}/order/list");
 							});
 						}else{
 							myAlert.alert(result.message);
 						}
 					});
				})
			}
			$(function(){ 
				pushHistory(); 
				  var bool=false;  
		            setTimeout(function(){  
		                  bool=true;  
		            },1000); 
				window.addEventListener("popstate", function(e) { 
					if(bool){
						var utl=document.referrer;
						if(isContains(utl, "list")){
							window.history.go(-1);
						}else{
							window.location.href="${BASE_PATH}/order/list";
						}
					}
					}, false); 
					function pushHistory() { 
						var state = { 
						title: "title", 
						url: "#"
						}; 
					window.history.pushState(state, "title","#" ); 
				} 
					function isContains(str, substr) {
					    return str.indexOf(substr) >= 0;
					}
			});	
		</script>
		<!-- tpl -->
		<script type="text/html" id="dataTpl">
 			{{if payState==<%=OrderCode.OrderPayState.NO_PAY%>}}
				<div class="info">
					<span class="goods">等待买家付款</span>
					<span class="address">剩 <a id="day"></a> 天 <a id="hours"></a> 时 <a id="min"></a> 分自动关闭</span>
				    <span class="tip">提示：包含现金的商品在下单7天内可无理由申请退款，超过7天申请退款无效。</span>
                 </div>
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.NO_CON%>}}
				{{if tuistate==<%=OrderCode.RefundState.ZERO%>}}
					<div class="info">						
						<span class="address">你的兑换有效期还有 <a id="day"></a> 天 <a id="hours"></a> 时 <a id="min"></a> 分</span>
					    <span class="tip">提示：包含现金的商品在下单7天内可无理由申请退款，超过7天申请退款无效。</span>
                     </div>
				{{else if tuistate==<%=OrderCode.RefundState.VERIFYING%>}}
					<div class="info">
						<span class="goods">订单正在退款中</span>
						<span class="address">您购买宝贝的积分及货款将退还至您的账户</span>
					</div>
				{{else if tuistate==<%=OrderCode.RefundState.REFUNDED%>}}
					<div class="info">
						<span class="goods">订单已退款</span>
						<span class="address">您购买宝贝的积分及货款已退还至您的账户</span>
					</div>
				{{/if}}
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.had_CON%>}}
				<div class="info">
					<span class="goods">交易成功</span>
					<span class="address">您的兑换码已使用</span>
				</div>
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.EXPIRE%>}}
				{{if tuistate==<%=OrderCode.RefundState.ZERO%>}}
					<div class="info">
						<span class="goods">您已错过兑换有效时间</span>
						<span class="address">您购买宝贝的积分及货款将退还至您的账户</span>
					</div>
				{{else if tuistate==<%=OrderCode.RefundState.VERIFYING%>}}
					<div class="info">
						<span class="goods">您已错过兑换有效时间</span>
						<span class="address">您购买宝贝的积分及货款将退还至您的账户</span>
					</div>
				{{else if tuistate==<%=OrderCode.RefundState.REFUNDED%>}}
					<div class="info">
						<span class="goods">订单已退款</span>
						<span class="address">您购买宝贝的积分及货款已退还至您的账户</span>
					</div>
				{{/if}}
			{{/if}}
			<div class="centert">
					<span class="shangjia">提货店铺</span>
					<div class="shop" >
						<span class="tit">{{title }}</span>
						<span class="nei">{{address }}</span></a>
						<a href="tel:{{tell }}"><span class="dianhua" ><i></i></span></a>
					</div>
			</div>
			<div class="goods_pic">
				<span class="shangjia">宝贝信息</span>
				<ul>
					<li><img src="${FTP_PATH}{{thumb}}"/></li>
					<span class="pic_textl">{{goodsName}}
                         <k style="display:block"> {{specTitle}}<k>
                    </span>
					{{if amount ==0}}
						<span class="pic_textl3">{{payPoint/countnum}} {{if pointType==1}}商品积分{{else if pointType==2}}健康积分{{else if pointType==3}}教育积分{{/if}}</span>
					{{else if  payPoint ==0}}
						<span class="pic_textl3">¥{{amount/countnum}}</span>
					{{else }}
                        <span class="pic_textl3">{{payPoint/countnum}} {{if pointType==1}}商品积分{{else if pointType==2}}健康积分{{else if pointType==3}}教育积分{{/if}} + ¥{{amount}}</span>

                    {{/if}}
					<span class="pic_textl2">¥{{marketPrice}}</span>
					<span class="pic_textr">×{{countnum}}</span>
				</ul>
					<span class="goods_rmbs">可获得:<a class="goods_rmb_nums">{{sppoint}}商品积分、{{jkpoint}}健康积分、{{jypoint}}教育积分</a></span>
					{{if amount !=0}}
					    <span class="goods_rmb">合计:<a class="goods_rmb_num">¥{{amount}}</span>
			        {{else if amount !=0 && payPoint !=0}}
                        <span class="goods_rmb">合计:<a class="goods_rmb_num">¥{{amount}} &nbsp;&nbsp;{{payPoint}} {{if pointType==1}}商品积分{{else if pointType==2}}健康积分{{else if pointType==3}}教育积分{{/if}} </a></span>

					{{else}}
					    <span class="goods_rmb">合计:<a class="goods_rmb_num">{{payPoint}} {{if pointType==1}}商品积分{{else if pointType==2}}健康积分{{else if pointType==3}}教育积分{{/if}} </a></span>
                    {{/if}}
			</div>
			{{if payState==<%=OrderCode.OrderPayState.NO_PAY%>}}
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.NO_CON%>}}
				
					{{if tuistate==<%=OrderCode.RefundState.ZERO%>}}
						<div class="order_times">
							<span class="num">到店兑换码(请到您购买宝贝的提货店铺进行兑换)</span>
							<span class="num">有效期至：{{guoDate}}</span>
							<span class="total_nums">兑换码：{{duihuanma}} <span class="sstate">未兑换</span></span>
						</div>
					{{else if tuistate==<%=OrderCode.RefundState.VERIFYING%>}}
						<div class="order_times">
							<span class="num">到店兑换码(请到您购买宝贝的提货店铺进行兑换)</span>
							<span class="num">有效期至：{{guoDate}}</span>
							<span class="total_numy">兑换码：{{duihuanma}} <span class="states">退款中</span></span>
						</div>
					{{else if tuistate==<%=OrderCode.RefundState.REFUNDED%>}}
						<div class="order_times">
							<span class="num">到店兑换码(请到您购买宝贝的提货店铺进行兑换)</span>
							<span class="num">有效期至：{{guoDate}}</span>
							<span class="total_numy">兑换码：{{duihuanma}} <span class="states">已退款</span></span>
						</div>
					{{/if}}
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.had_CON%>}}
				<div class="order_times">
					<span class="num">到店兑换码(请到您购买宝贝的提货店铺进行兑换)</span>
					<span class="num">有效期至：{{guoDate}}</span>
					<span class="total_numx">兑换码：{{duihuanma}} <span class="states">已兑换</span></span>
				</div>
			{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.EXPIRE%>}}
				<div class="order_times">
					<span class="num">到店兑换码(请到您购买宝贝的提货店铺进行兑换)</span>
					<span class="num">有效期至：{{guoDate}}</span>
					<span class="total_numy">兑换码：{{duihuanma}} <span class="states">已过期</span></span>
					<span class="total_numm">{{if tuistate==1}}积分及货款返还中{{else if tuistate==2}}积分及货款已返还到您的账户{{/if}}</span>
				</div>
			{{/if}}	
			
			
			<div class="order_timea">
				<span class="num">订单号：{{orderNum}}</span>
				<span class="num">下单时间：{{startDate}}</span>
                {{if bespokeDate}}
				   <span class="num">预约时间：{{bespokeDate}}</span>
                {{/if}}
				<span class="num">下单手机号：{{tel}}</span>
				{{if payState==<%=OrderCode.OrderPayState.NO_PAY%>}}
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.NO_CON%>}}
					<span class="num">付款时间：{{payDate}}</span>
					<span class="num">支付方式：在线支付(微信支付)</span>
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.had_CON%>}}
					<span class="num">付款时间：{{payDate}}</span>
					<span class="num">兑换时间：{{deliverDate}}</span>
					<span class="num">支付方式：在线支付(微信支付)</span>
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.EXPIRE%>}}
					<span class="num">付款时间：{{payDate}}</span>
					<span class="num">支付方式：在线支付(微信支付)</span>
				{{/if}}	
			</div>
			<div class="btn_box">	
				{{if payState==<%=OrderCode.OrderPayState.NO_PAY%>}}
					<span class="pays" onclick="toCancel('{{orderNum}}');" >取消订单</span>
					<span class="pay" onclick="gopay('{{orderNum}}',{{amount}});" >去支付</span>
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.NO_CON%>}}
					{{if tuistate==<%=OrderCode.RefundState.ZERO%>}}
						<span class="pays" onclick="doRefund();" >申请退款</span>
					{{else if tuistate==<%=OrderCode.RefundState.VERIFYING%>}}
						<span class="pay" onclick="doDelete();" >删除订单</span>
					{{else if tuistate==<%=OrderCode.RefundState.REFUNDED%>}}
						<span class="pay" onclick="doDelete();" >删除订单</span>
					{{/if}}
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.had_CON%>}}
					<span class="pay" onclick="doDelete();" >删除订单</span>
				{{else if payState==<%=OrderCode.OrderPayState.HAD_PAY%> && orderState==<%=OrderCode.OrderState.EXPIRE%>}}
					{{if tuistate==<%=OrderCode.RefundState.ZERO%>}}
						<span class="pays" onclick="doRefund();" >申请退款</span>
					{{else if tuistate==<%=OrderCode.RefundState.VERIFYING%>}}
						<span class="pay" onclick="doDelete();" >删除订单</span>
					{{else if tuistate==<%=OrderCode.RefundState.REFUNDED%>}}
						<span class="pay" onclick="doDelete();" >删除订单</span>
					{{/if}}
				{{/if}}			
			</div>
		</script>
	</body>
</html>
